import React, { Component } from "react";
import { Redirect } from "react-router-dom";
export default class GameLobby extends Component {
  state = {
    isLogin: false
  };
  constructor() {
    super();
  }

  //在组件内使用箭头函数需要设置babel插件transform-class-properties
  renderLobbyPage = () => {
    var renderData;
  
    if (!this.state.isLogin) {
      renderData = <Redirect to="/Navbar"></Redirect>;
    } else {
      renderData = <div>welcome to gameLobby </div>;
    }

    return renderData;
  };
  render() {
    return <div>{this.renderLobbyPage()}</div>;
  }
}
